package com.itheima.a04threadmethod1;

public class MyThread extends Thread{
    public MyThread(){

    }

    public MyThread(String name){
        super(name);
    }
    @Override
    public void run() {

        //线程要进行的任务
        for(int i=0;i<100;i++){
            try {
                Thread.sleep(1000);
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
            System.out.println(getName()+"@"+i);
        }
    }
}
